package collection;

public class SumListVisitor implements IListVisitor<Integer, Integer> {

	@Override
	public Integer visit(ConsList<Integer> consList) 
	{
		return consList.first() + consList.rest().accept(this);
	}

	@Override
	public Integer visit(MTList<Integer> mtList) 
	{
		return 0;
	}

}
